// 设置定时6个小时删除cookie
//设置 
function cookieSet(name, value = 1) { 
  //* 24 * 60 * 60 * 1000
   var exp = new Date(); exp.setTime(exp.getTime() + 60 * 60 * 1000 * 24); 
  document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString(); 
  // document.cookie = name + "=" + escape(value) + ";"; 
}
//获取 
function cookieGet(name) { 
  var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); 
  arr = document.cookie.match(reg)
  if (arr) {
    return decodeURI(arr[2]); 
  } 
  else {
    return null;
  } 
}
// 删除 
function delCookie(name) {
  var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval = cookieGet(name); 
  if (cval != null) {
    document.cookie = name + "=" + cval+ ";expires=" + exp.toGMTString();
  }
}

export { cookieSet,cookieGet,delCookie}
